$(document).ready(function()
{  
	$('.confirmAction').click(function(e)
	{
		e.preventDefault();
		var idElement = $(this).attr('id');
		
		var contentBdbdec = '<center><strong>Attention</strong> vous &ecirc;tes sur le point de supprimer un element de la collection. Cette action est irreversible ! <br /><br /> <strong>Souhaitez vous continuer ?</strong><form action="' + urlBdbdec + '/bdbdec.php?action=deleteElement&amp;typeElt=' + typeElt + '" method="post"><input type="submit" value="Oui" name="yes">&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="Non" name="no" class="nyroModalClose"><input type="hidden" value="' + idElement + '" name="idElement"><input type="hidden" value="' + typeElt + '" name="typeElement"></form><br /></center>';
		
		$.fn.nyroModalManual({
			content: contentBdbdec,
			showBackground: showBackgroundBDBDEC,
			hideBackground: hideBackgroundBDBDEC,
			showContent: showContentBDBDEC,
			hideContent: hideContentBDBDEC,
			bgColor: '#cfe3ef',
			css: { 
				bg: {
				  zIndex: 100,
				  position: 'fixed',
				  top: 0,
				  left: 0,
				  height: '100%',
				  width: '100%'
				},
				wrapper: {
				  zIndex: 101,
				  position: 'fixed',
				  top: '50%',
				  left: '50%',
				  paddingLeft : '20px',
				  paddingRight : '20px'
				},
				content: {
				  overflow: 'hidden'
				},
				loading: {
				  zIndex: 102,
				  position: 'fixed',
				  top: '50%',
				  left: '50%',
				  marginTop: '-50px',
				  marginLeft: '-50px'
				}
			  }
			});
		return false;
	});
	
	$(".formChangeSerie").validate({
		rules : {
			nameElement: {required:true, maxlength:64},
			genreSerie: {required:true, maxlength:20},
			typeSerie: {required:true, maxlength:20}
		
		},
		messages: {
			nameElement: {required:"Requis", maxlength:"64 caract&egrave;res max"},
			genreSerie: {required:"Requis", maxlength:"20 caract&egrave;res max"},
			typeSerie: {required:"Requis", maxlength:"20 caract&egrave;res max"}
		}
	});
	
	$(".formChangeElement").validate({
		rules : {
			nameElement: {required:true, maxlength:64}
		},
		messages: {
			nameElement: {required:"Requis", maxlength:"64 caract&egrave;res max"}
		}
	});
});
	